<?php

use Illuminate\Support\Facades\Route;
// 引用用户控制器
use App\Http\Controllers\Business;
use App\Http\Controllers\Address;
use App\Http\Controllers\Product;
use App\Http\Controllers\Cart;
use App\Http\Controllers\Order;
use App\Http\Controllers\Pay;
//  business分组路由
Route::prefix('business')->group(function () {
    Route::post('/register', [Business::class, 'register']);
    Route::post('/login', [Business::class, 'login']);
    Route::post('/checklogin', [Business::class,'checklogin']);
    Route::post('/profile', [Business::class,'profile']);
    Route::post('/sendmail', [Business::class,'sendmail']);
    Route::post('/delmail', [Business::class,'delmail']);
    Route::post('/email', [Business::class,'email']);
    Route::post('/forget', [Business::class,'forget']);
    Route::post('/reset', [Business::class,'reset']);
    Route::post('/sendByEmail', [Business::class,'sendByEmail']);
    Route::post('/updloads', [Business::class,'updloads']);
    Route::post('/delImg', [Business::class,'delImg']);
    Route::post('/record', [Business::class,'record']);
});
// 地址分组路由
Route::prefix('address')->group(function () {
    Route::post('/add', [Address::class, 'add']);
    Route::post('/edit', [Address::class, 'edit']);
    Route::post('/del', [Address::class, 'del']);
    Route::post('/getAddressList', [Address::class, 'getAddressList']);
    Route::post('/setDefault', [Address::class, 'setDefault']);
    Route::post('/getAddressById', [Address::class, 'getAddressById']);
    Route::post('/order',[Address::class,'order']);
});

// 产品分组路由
Route::prefix('/product')->group(function(){
    Route::post('/type',[Product::class,'type']);
    Route::post('/index',[Product::class,'index']);
    Route::post('/list',[Product::class,'list']);
    Route::post('/typeShopList',[Product::class,'typeShopList']);
    Route::post('/info',[Product::class,'info']);
    Route::post('/qingyunke',[Product::class,'qingyunke']);
});
// 购物车
Route::prefix('/cart')->group(function(){
    Route::post('/add',[Cart::class,'add']);
    Route::post('/index',[Cart::class,'index']);
    Route::post('/edit',[Cart::class,'edit']);
    Route::post('/del',[Cart::class,'del']);
});
//订单
Route::prefix('/order')->group(function(){
    Route::post('/add',[Order::class,'add']);
    Route::post('/index',[Order::class,'index']);
    Route::post('/buy',[Order::class,'buy']);
    Route::post('/payment',[Order::class,'payment']);
    Route::post('/callback',[Order::class,'callback']);
    Route::post('/notice',[Order::class,'notice']);
    Route::post('/info',[Order::class,'info']);
    Route::post('/confirm',[Order::class,'confirm']);
    Route::post('/rate',[Order::class,'rate']);
    Route::post('/refund',[Order::class,'refund']);
    Route::post('/expresslist',[Order::class,'expresslist']);
    Route::post('/refundgoods',[Order::class,'refundgoods']);
    Route::post('/pay',[Order::class,'pay']);
});
// 支付
Route::prefix('/pay')->group(function(){
    Route::post('/pay',[Pay::class,'pay']);
    Route::post('/notice',[Pay::class,'notice']);
    Route::post('/callback',[Pay::class,'callback']);
    Route::post('/paylist',[Pay::class,'paylist']);
   
});